package	com.sdry.service.impl.inventoryInfoOnlyCountRejects;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sdry.mapper.inventoryInfoOnlyCountRejects.InventoryInfoOnlyCountRejectsMapper;
import com.sdry.model.inventoryInfoOnlyCountRejects.InventoryInfoOnlyCountRejects;
import com.sdry.model.jyy.Receive;
import com.sdry.model.lz.CodeMark;
import com.sdry.model.lz.Materiel;
import com.sdry.service.inventoryInfoOnlyCountRejects.InventoryInfoOnlyCountRejectsService;
/**
 *
 *@ClassName: InventoryInfoOnlyCountRejectsService
 *@Description: 精简不良品库存
 *@Author tdd
 *@Date 2019-09-04 15:22:59
 *@version 1.0
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class InventoryInfoOnlyCountRejectsServiceImpl implements InventoryInfoOnlyCountRejectsService {
	@Resource InventoryInfoOnlyCountRejectsMapper InventoryInfoOnlyCountRejectsMapper;
	/** 
	 * 根据主键id查询实体
	 * @param id 主键id
	 * @return 实体
	*/
	public InventoryInfoOnlyCountRejects queryById(Long id) {
		return InventoryInfoOnlyCountRejectsMapper.queryById(id);
	}
	/** 
	 * 条件查询所有
	 * @param param 实体条件
	 * @return 实体集合
	*/
	public List<InventoryInfoOnlyCountRejects> queryAllByMution(InventoryInfoOnlyCountRejects param) {
		return InventoryInfoOnlyCountRejectsMapper.queryAllByMution(param);
	}
	/** 
	 * 条件分页查询
	 * @param param 实体条件
	 * @return 实体集合
	*/
	public List<InventoryInfoOnlyCountRejects> findPageByMution(InventoryInfoOnlyCountRejects param) {
		return InventoryInfoOnlyCountRejectsMapper.findPageByMution(param);
	}
	/** 
	 * 条件查询记录数
	 * @param param 实体条件
	 * @return 实体集合
	*/
	public Integer selectCountByMution(InventoryInfoOnlyCountRejects param) {
		return InventoryInfoOnlyCountRejectsMapper.selectCountByMution(param);
	}
	/** 
	 * 插入返回id
	 * @param param 实体条件
	 * @return 主键id
	*/
	public Long insert(InventoryInfoOnlyCountRejects param) {
		return InventoryInfoOnlyCountRejectsMapper.insert(param);
	}
	/** 
	 * 根据主键更新 返回影响行数
	 * @param param 实体条件
	 * @return 影响行数
	*/
	public Integer update(InventoryInfoOnlyCountRejects param) {
		return InventoryInfoOnlyCountRejectsMapper.update(param);
	}
	/** 
	 * 根据主键拼接的字符串删除返回影响行数
	 * @param ids 主键拼接的字符串
	 * @return 影响行数
	*/
	public Integer delete(String ids) {
		return InventoryInfoOnlyCountRejectsMapper.delete(ids);
	}
	/**
	 * 添加损益
	 */
	public Long profitAndLoss(InventoryInfoOnlyCountRejects param) {
		return InventoryInfoOnlyCountRejectsMapper.profitAndLoss(param);
	}
	/**
	 * 根据库位查询时间之前的数据
	 * @param location_code 库位
	 * @param send_date 时间
	 * @return 收货单
	 */
	public List<Receive> selectReceiveByLocation_codeAndSend_date(String location_code,String send_date){
		return InventoryInfoOnlyCountRejectsMapper.selectReceiveByLocation_codeAndSend_date(location_code, send_date);
	}
	/**
	 * 根据库位、收货单号查询时间之前的物料
	 * @param location_code 库位
	 * @param send_date 时间
	 * @param receive_number 收货单号
	 * @return 条码
	 */
	public List<Materiel> select_materielByLocation_codeAndSend_date(
			String location_code, String send_date, String receive_number){
		return InventoryInfoOnlyCountRejectsMapper.select_materielByLocation_codeAndSend_date(location_code, send_date, receive_number);
	}
	/**
	 * 根据库位、收货单号查询时间之前的条码
	 * @param location_code 库位
	 * @param send_date 时间
	 * @param receive_number 收货单号
	 * @param mid 物料id
	 * @return 条码
	 */
	public List<CodeMark> selectCodeByLocation_codeAndSend_dateAndReceive_number(String location_code,String send_date,String receive_number,Long mid){
		return InventoryInfoOnlyCountRejectsMapper.selectCodeByLocation_codeAndSend_dateAndReceive_number(location_code, send_date, receive_number,mid);
	}
}
